package demo;

public class tree {

    static class TreeNode {

        private TreeNode left;
        private TreeNode right;
        public char val;

        public TreeNode(char val) {
            this.val = val;
        }
    }

    public TreeNode root;

    public TreeNode createNode(char val)
    {
        if(root == null)
        {
            TreeNode node = new TreeNode(val);
            root = node;
            return root;
        }
        TreeNode node = new TreeNode(val);
        return node;
    }

    public static void main(String[] args) {
        tree tree = new tree();
        tree.createNode('a');
        tree.createNode('b');
        tree.createNode('c');
        tree.createNode('d');
        tree.createNode('e');

    }
}